/*
 * App_HandleInput.cpp
 *
 *  Created on: 3 mai 2009
 *      Author: CHETIER
 */

#include "Application.h"
#include "InputState.h"

int Application::HandleInput(InputState *pInputState)
{
	//SDL event
	SDL_Event event;
	pInputState->Reset();

	while(SDL_PollEvent(&event))
	{
		switch(event.type)
		{
			case SDL_QUIT:
				pInputState->setKeyDown_Quit(true);
			break;
			case SDL_KEYDOWN:
			if (event.key.keysym.sym == SDLK_ESCAPE)
				pInputState->setKeyDown_Quit(true);
			break;
		}
	}

	return EXIT_SUCCESS;
}
